<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/jsp/inc/header.jsp" %>
<c:set var="title" value="站点"/>
<c:set var="rootpath" value="${CONTEXT_PATH}/admin/site/site"/>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="${STATIC_HOST}/css/ligerui.css" rel="stylesheet" type="text/css"/>
    <link href="${STATIC_HOST}/css/common.css" rel="stylesheet" type="text/css" />
    <script src="${STATIC_HOST}/js/common.js" type="text/javascript"></script>
    <script src="${STATIC_HOST}/js/LG.js" type="text/javascript"></script>
    <title>${site.id==0 ? '新增' : '修改'}${title}</title>
</head>
<body>
<form:form commandName="site" class="l-form" id="mainform" name="mainform" method="post" action="${rootpath}/save.do">
  <div class="l-group l-group-hasicon"><img src="${STATIC_HOST}/images/common/communication.gif"><span>当前位置: 宇宙CMS &gt; <a href="${rootpath}/list.do">${title}管理</a> &gt; ${site.id==0 ? '新增' : '修改'}${title}</span></div>
    <div id="errorLabelContainer"> <form:errors path="*"/>${error.param.wrong}</div>
        <input type="hidden" name="queryParam" value="${queryParam}"/>
        <input type="hidden" name="id" id="id" value="${site.id}"/>
      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="name">站点名称</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
        <input type="text" name="name" id="name" size="60" maxlength="100" ltype='text'  validate="{required:true,minlength:0,maxlength:100}" value="${site.name}"/>
       <span class='formValidatorError'><form:errors path="name" /></span>
      </li>
      </ul><!--换行-->

      <ul>
        <li class="li_show_left" style="padding-left:30px;"><label for="code">站点代号</label> <span style="color:red">*</span>:</li>
        <li class="li_show_right">
            <input type="text" name="code" id="code" size="60" maxlength="100" ltype='text' validate="{required:true,minlength:0,maxlength:100}" value="${site.code}" ${site.id==0 ? '' : 'readonly'}/>
            <span class='formValidatorError'><form:errors path="code" /></span>
        </li>
      </ul><!--换行-->

      <ul>
        <li class="li_show_left" style="padding-left:30px;"><label for="domainName">站点域名</label>:</li>
        <li class="li_show_right">
            <input type="text" name="domainName" id="domainName" size="60" maxlength="100" ltype='text' validate="{required:true,minlength:0,maxlength:100}" value="${site.domainName}" ${site.id==0 ? '' : 'readonly'}/>
            <span class='formValidatorError'><form:errors path="code" /></span>
        </li>
      </ul><!--换行-->

    <ul>
        <li class="li_show_left" style="padding-left:30px;"><label for="path">存储路径</label>:</li>
        <li class="li_show_right">
            <input type="text" name="path" id="path" size="60" maxlength="200" ltype='text' readonly  validate="{minlength:0,maxlength:200}" value="${site.path}"/>
            <span class='formValidatorError'><form:errors path="path" /></span>
        </li>
    </ul><!--换行-->

      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="status">状态</label> <span style="color:red">*</span>:</li>
           <li class="li_show_right">
        <select name="status" id="status" ltype="select" size="1" >
		  <c:forEach var="obj" items="${statusMap}" varStatus="idx">
          <option value="${obj.key}" <c:if test="${site.status==obj.key}">selected</c:if>>${obj.value}</option>
		  </c:forEach>
        </select>
      </li> 
      </ul><!--换行-->

      <ul>
      <li class="li_show_left" style="padding-left:30px;"><label for="memo">备注</label>:</li>
           <li class="li_show_right" style="width:50%">
        <textarea name="memo" id="memo" rows="3" cols="80" class="l-textarea" validate="{minlength:0,maxlength:420}">${site.memo}</textarea>
       <span class='formValidatorError'><form:errors path="memo" /></span>
      </li> 
      </ul><!--换行-->

  <div class="l-group l-group-hasicon"></div> 
  <input type="submit" value="提交" id="mainformsubmit" class="l-button l-button-submit form_submit_button"/> 
  <c:if test="${fn:contains(header.referer,rootpath)}"><input type="button" value="返回" class="l-button l-button-test" style="float:left;" onClick="location.href='${header.referer}'" /></c:if>
</form:form>
<script type="text/javascript" >
var mainform = $("#mainform");
mainform.ligerForm();
$(function(){
	$("#code").bind('keyup', function (){
	    var temp = "${site.path}";
	    var path = temp+$("#code").val();
		$("#path").val(path);

	});
});

</script>
<div id="scrolltop">返回顶部</div>
<%@ include file="/jsp/inc/footer.jsp"%>
</body>
</html>